Graphical modeling languages use various types of components to represent structure and functionality graphically. For example, SIMULINK® from The MathWorks, Inc. of Natick, Mass. is a block diagramming software package that represents structure and functionality graphically as model components using blocks and connections. Most graphical languages have the concept of organizing structure and functionality hierarchically and packaging certain hierarchical pieces into defined components that are stored in libraries or other locations. Using a defined component in a model is called ‘instantiating’ the component and the component as it is used in the model is an ‘instance’ of the defined component. One or many instances of a defined component may be instantiated in a model.
Most modern textual programming languages offer reusability, either by simple function libraries, class libraries or template libraries. Some textual programming languages extend component reusability by utilizing the concept of templatization. That is, reusable components leave some portion of their implementation to be defined by their point of use. For the purposes of this discussion, templatization may be subdivided into two simple categories, “functional templatization” and “structural templatization.”
Functional templatization allows a function to infer its functionality based on the argument passed to the function. For example, the MATLAB® language (a technical programming language from The MathWorks, Inc.) has no strong typing and a MATLAB®function's implementation places certain constraints on the types and dimensions of arguments passed it. It is only when the type and dimension of the input arguments are known at runtime that the full functionality of the MATLAB® function is defined. Similarly, C++ provides this functionality such that functions may defer the determination of the types of functions' arguments to their point of use. In C++ this may be accomplished either by polymorphism in which case the arguments' types are determined at runtime or by template functions, in which case the arguments' types are determined at compile time.
Structural templatization allows data structures, or more generally a collection of programming language constructs, to defer the behavior of their components to their point of use or instantiation. In C++ this may be accomplished by polymorphism or by class templates.
Some graphical modeling languages already include the concept of functional templatization. For example, SIMULINK® blocks do not necessary require their input or parameter types (data type, dimension, sample time, etc) to be fully determined when the blocks are defined. Rather, these attributes are determined at their point of use. For example, the Gain block does not require a specific gain format or input dimension but does require them to be consistent at the point of use.
It would be beneficial to model designers in a graphical modeling environment to be able to graphically manage a form of structural templatization that allows implementation information from a component to be propagated to interface model components. Such a form of structural templatization would allow a designer to quickly merge interface information from a component with a defined interface with the content from other components thus increasing the flexibility, reusability, and efficiency of the model design process. Unfortunately, conventional graphical modeling languages do not provide a mechanism for graphically performing structural templatization that allows the interface of a model component to be separated from the content of the model component and propagated to other instantiated model components.